package com.jumper.study.db.model;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.OrderBy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

//课程章节
@TableName("lesson_chapters")
public class LessonChapter implements Serializable {
    @TableId(type=IdType.AUTO)
    private Long id;

    @TableField(updateStrategy = FieldStrategy.NOT_NULL)
    private Long lessonId;

    private String title;

    //视频地址
    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY, updateStrategy = FieldStrategy.NOT_EMPTY)
    private String video;

    //视频时长
    @TableField(updateStrategy = FieldStrategy.NOT_NULL)
    private Integer duration;

    //视频类型,1:本地视频
    @TableField(updateStrategy = FieldStrategy.NOT_NULL)
    private Integer type;

    @TableField(updateStrategy = FieldStrategy.NOT_NULL)
    private Boolean onself;

    //章节总学习时长
    @TableField(insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
    private Long studyTimes;

    @TableField("`sort`")
    @OrderBy(asc = true)
    private Integer sort;

    @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    private LocalDateTime createdAt;

    @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    private LocalDateTime updatedAt;

    @TableLogic
    private Integer deleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getLessonId() {
        return lessonId;
    }

    public void setLessonId(Long lessonId) {
        this.lessonId = lessonId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getVideo() {
        return video;
    }

    public void setVideo(String video) {
        this.video = video;
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Boolean getOnself() {
        return onself;
    }

    public void setOnself(Boolean onself) {
        this.onself = onself;
    }

    public Long getStudyTimes() {
        return studyTimes;
    }

    public void setStudyTimes(Long studyTimes) {
        this.studyTimes = studyTimes;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }
}
